<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>码匠社区</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link th:href="@{/css/bootstrap-theme.min.css}" rel="stylesheet">
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <link rel="stylesheet" th:href="@{/css/community.css}">
    <script th:src="@{/js/jquery-3.5.0.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
</head>
<body>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">码匠社区</span>
            </button>
            <a class="navbar-brand" href="#">码匠社区</a>
        </div>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <form class="navbar-form navbar-left">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="搜索问题">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown" th:if="${session.user}">
                    <a th:href="@{/publish}" role="button">发布</a>
                </li>
                <li class="dropdown" th:if="${session.user}">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false" th:text="${session.user.getName()}"><span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">消息中心</a></li>
                        <li><a href="#">个人资料</a></li>
                        <li><a href="#">退出登录</a></li>
                    </ul>
                </li>
                <li th:unless="${session.user}">
                    <a href="https://gitee.com/oauth/authorize?client_id=eaf58216baf68f414e083c0d3a2d10d0fcf97d1d8e0da77d0cfed18f8857edc6&redirect_uri=http://localhost:8080/callback&state=1&response_type=code">登录</a>
                </li>
            </ul>
        </div>
    </div>
</nav>
<div class="container-fluid context">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <h2>发起<span class="glyphicon glyphicon-list" aria-hidden="true"></span></h2>
            <hr/>
            <div class="media" th:each="question: ${questions}">
                <div class="media-left">
                    <a href="#">
                        <img class="media-object img-circle" th:src="${question.user.avatarUrl}">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading" th:text="${question.title}"></h4>
                    <div th:text="${question.description}"></div>
                    <span class="text-desc">
                         <span th:text="${question.commentCount}"></span> 个评论 • <span
                            th:text="${question.viewCount}"></span> 次浏览 • 4 天前
                    </span>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <h3>热门话题</h3>
        </div>
    </div>
</div>
</body>
</html>